package delivery.order.service.api;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 渲染前端项目
 */
@Controller
public class RenderPage {
    private static final Logger logger = LoggerFactory.getLogger(RenderPage.class);

    //前端项目
    @GetMapping("/order")
    public String get01() {
        return "forward:/index.html";
    }

    //前端项目2
//    @GetMapping("/ui2")
//    public String get02() {
//        return "forward:/index2.html";
//    }

    // 阻止直接访问根路径，返回404或重定向
    @GetMapping("/")
    public ResponseEntity<String> blockRootAccess() {
        return ResponseEntity.status(HttpStatus.NOT_FOUND).body("请输入正确的url访问");
    }


}
